//function to select all check boxes and to unselect all check boxes
function checkAll(frmMain, checktoggle)
{
    var checkboxes = new Array();
    checkboxes = document[frmMain].getElementsByTagName('input');

    for (var i = 0; i < checkboxes.length; i++) {
        if (checkboxes[i].type == 'checkbox') {
            checkboxes[i].checked = checktoggle;
        }
    }
}


function checkall(el) {
    var ip = document.getElementsByTagName('input'), i = ip.length - 1;
    for (i; i > -1; --i) {
        if (ip[i].type && ip[i].type.toLowerCase() === 'checkbox') {
            ip[i].checked = el.checked;
        }
    }
}
// confirmation whether to delete or not
function onDelete()
{
    if (confirm('Do you want to delete ?') == true)
    {
        return true;
    }
    else
    {
        return false;
    }
}


function allCheck(name,boolValue) {
	var allvalue = document.getElementsByName(name); 
	for (var i = 0; i < allvalue.length; i++) {      
		if (allvalue[i].type == "checkbox")           
			allvalue[i].checked = boolValue;           
	}
}
function reserveCheck(name){
	var revalue = document.getElementsByName(name); 
	for(i=0;i<revalue.length;i++){
   		if(revalue[i].checked == true) 
			revalue[i].checked = false;
  		else 
			revalue[i].checked = true;
	}
}

